package util;

import java.time.Instant;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.Locale;

/**
 * https://blog.csdn.net/f641385712/article/details/81429389
 */
public class TimeUtil {
    static DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
    static DateTimeFormatter formatter2 = DateTimeFormatter.ofPattern("E, yyyy-MMMM-dd HH:mm:ss", Locale.CHINA);

    public static String nowDateTime() {
        // System.out.println(LocalDateTime.now().format(formatter2));
        return Instant.now().atZone(ZoneId.systemDefault()).format(formatter);
    }
}
